package com.ruibang.glass.produce.controller.bcp;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.ruibang.glass.produce.domain.req.BcpDeviceParamReq;
import com.ruibang.glass.produce.domain.resp.*;
import com.ruibang.glass.produce.service.BcpDeviceParamService;
import com.teaming.cloud.framework2.common.model.ResultBody;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;

/**
 * @Author: songJinKang
 * @CreateTime: 2024-04-19  10:18
 * @Description: TODO:BCP设备参数信息控制器
 * @Version: 1.0
 */


@Api(tags = "BCP设备参数信息控制器")
@RestController
@RequestMapping("/api/glass/produce/bcp/deviceParam")
public class BcpDeviceParamController {

    @Autowired
    private BcpDeviceParamService bcpDeviceParamService;

    @PostMapping("/queryHqDeviceParamInfo")
    @ApiOperation(value = "查询横切设备参数信息", response = ResultBody.class)
    public ResultBody<IPage<HqDeviceParamInfo>> queryHqDeviceParamInfo(@RequestBody BcpDeviceParamReq bcpDeviceParamReq) {
        return ResultBody.success(bcpDeviceParamService.queryHqDeviceParamInfo(bcpDeviceParamReq));
    }

    @PostMapping("/queryZqDeviceParamInfo")
    @ApiOperation(value = "查询纵切设备参数信息", response = ResultBody.class)
    public ResultBody<IPage<ZqDeviceParamInfo>> queryZqDeviceParamInfo(@RequestBody BcpDeviceParamReq bcpDeviceParamReq) {
        return ResultBody.success(bcpDeviceParamService.queryZqDeviceParamInfo(bcpDeviceParamReq));
    }

    @PostMapping("/queryBbDeviceParamInfo")
    @ApiOperation(value = "查询掰板设备参数信息", response = ResultBody.class)
    public ResultBody<IPage<BbDeviceParamInfo>> queryBbDeviceParamInfo(@RequestBody BcpDeviceParamReq bcpDeviceParamReq) {
        return ResultBody.success(bcpDeviceParamService.queryBbDeviceParamInfo(bcpDeviceParamReq));
    }

    @PostMapping("/querySbDeviceParamInfo")
    @ApiOperation(value = "查询上板设备参数信息", response = ResultBody.class)
    public ResultBody<IPage<SbDeviceParamInfo>> querySbDeviceParamInfo(@RequestBody BcpDeviceParamReq bcpDeviceParamReq) {
        return ResultBody.success(bcpDeviceParamService.querySbDeviceParamInfo(bcpDeviceParamReq));
    }

    @PostMapping("/queryXbDeviceParamInfo")
    @ApiOperation(value = "查询下板设备参数信息", response = ResultBody.class)
    public ResultBody<IPage<XbDeviceParamInfo>> queryXbDeviceParamInfo(@RequestBody BcpDeviceParamReq bcpDeviceParamReq) {
        return ResultBody.success(bcpDeviceParamService.queryXbDeviceParamInfo(bcpDeviceParamReq));
    }

    @PostMapping("/queryFxDeviceParamInfo")
    @ApiOperation(value = "查询分选设备参数信息", response = ResultBody.class)
    public ResultBody<IPage<FxDeviceParamInfo>> queryFxDeviceParamInfo(@RequestBody BcpDeviceParamReq bcpDeviceParamReq) {
        return ResultBody.success(bcpDeviceParamService.queryFxDeviceParamInfo(bcpDeviceParamReq));
    }


    /**
     * 导出
     */
    @PostMapping("/exportHqDeviceParamInfo")
    @ApiOperation(value = "导出横切设备参数信息", response = ResultBody.class)
    public void exportHqDeviceParamInfo(@RequestBody BcpDeviceParamReq bcpDeviceParamReq, HttpServletResponse response) {
        bcpDeviceParamService.exportHqDeviceParamInfo(bcpDeviceParamReq, response);
    }

    @PostMapping("/exportZqDeviceParamInfo")
    @ApiOperation(value = "导出纵切设备参数信息", response = ResultBody.class)
    public void exportZqDeviceParamInfo(@RequestBody BcpDeviceParamReq bcpDeviceParamReq, HttpServletResponse response) {
        bcpDeviceParamService.exportZqDeviceParamInfo(bcpDeviceParamReq, response);
    }

    @PostMapping("/exportBbDeviceParamInfo")
    @ApiOperation(value = "导出掰板设备参数信息", response = ResultBody.class)
    public void exportBbDeviceParamInfo(@RequestBody BcpDeviceParamReq bcpDeviceParamReq, HttpServletResponse response) {
        bcpDeviceParamService.exportBbDeviceParamInfo(bcpDeviceParamReq, response);
    }

    @PostMapping("/exportSbDeviceParamInfo")
    @ApiOperation(value = "导出上板设备参数信息", response = ResultBody.class)
    public void exportSbDeviceParamInfo(@RequestBody BcpDeviceParamReq bcpDeviceParamReq, HttpServletResponse response) {
        bcpDeviceParamService.exportSbDeviceParamInfo(bcpDeviceParamReq, response);
    }

    @PostMapping("/exportXbDeviceParamInfo")
    @ApiOperation(value = "导出下板设备参数信息", response = ResultBody.class)
    public void exportXbDeviceParamInfo(@RequestBody BcpDeviceParamReq bcpDeviceParamReq, HttpServletResponse response) {
        bcpDeviceParamService.exportXbDeviceParamInfo(bcpDeviceParamReq, response);
    }

    @PostMapping("/exportFxDeviceParamInfo")
    @ApiOperation(value = "导出分选设备参数信息", response = ResultBody.class)
    public void exportFxDeviceParamInfo(@RequestBody BcpDeviceParamReq bcpDeviceParamReq, HttpServletResponse response) {
        bcpDeviceParamService.exportFxDeviceParamInfo(bcpDeviceParamReq, response);
    }
}
